package Server.DataBase;

import java.util.ArrayList;

/**
 * 
 * @author Polak Ido
 *
 */
public class Student extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	/**
	 * student class id number
	 */
	private int idClass;
	private ArrayList<Reg> areg;
	
	/**
	 * constructor
	 * @param idUser
	 * @param userName
	 * @param password
	 * @param permission
	 * @param online
	 * @param firstName
	 * @param lastName
	 * @param idClass
	 */
	public Student(int idUser, String userName, String password,
			int permission, int online, String firstName, String lastName,
			int idClass) {
		super(idUser, userName, password, permission, online, firstName,
				lastName);
		this.idClass = idClass;
	}
	
	public Student(int idUser, String userName, String password,
			int permission, int online, String firstName, String lastName,
			int idClass, ArrayList<Reg> areg) {
		super(idUser, userName, password, permission, online, firstName,
				lastName);
		this.idClass = idClass;
		this.areg=areg;
	}
	/**
	 * 
	 * @param user
	 * @param idClass
	 */
	public Student(User user, int idClass) {
		super(user.getIdUser(), user.getUserName(), user.getPassword(), user.getPermission(), user.isOnline(), user.getFirstName(),
				user.getLastName());
		this.idClass = idClass;
	}

	
	/**
	 * @return class id
	 */
	public int getIdClass() {
		return idClass;
	}
	
	public ArrayList<Reg> getAreg() {
		return areg;
	}

	/**
	 * set class id
	 * @param idClass
	 */
	public void setIdClass(int idClass) {
		this.idClass = idClass;
	}
	/**
	 * get student name
	 */
	public String toString(){
		return getLastName()+" "+getFirstName();	
	}
}
